<!-- sua bai viet-->
<?php echo validation_errors(); ?>

<form method="POST" action="<?php echo base_url().'admin/xuly/danhmucsp/list/'.$this->uri->segment(5);?>">
<div class="box_heading">
    <div class="icon">
    <img src="<?php echo base_url().'template/admin/images/icon_settings.png';?>"/> Sửa Danh mục sản phẩm( <span style="color: red;"> * : không được để trống</span> )  <?php if(!empty($thongbao)){echo '<img src='.base_url().'template/admin/images/ok.png class="ok"><font color=red><b>'.$thongbao.'</b></font>';}?>
    </div>
    <div class="right">    
    <a href="<?php echo base_url().'admin/xuly/danhmucsp';?>">Hủy</a>
    </div>
</div>

<div class="box_noidung">
<table class="form">
<tr><td><font color=red>* </font>Tiêu đề</td><td><input type="text" size="40" value="<?php if(!empty($data)){echo $data->title;};?>" name="title"/></td></tr>
<tr><td><font color=red>* </font>Alias</td><td><input type="text" size="40" value="<?php if(!empty($alias)){echo $alias->alias;}?>" name="alias"/>(Alias sẽ hiển thị trên url trình duyệt)</td></tr>
<tr><td><font color=red>* </font>Trạng thái</td><td>
                                            <select name="publish">                                            
                                              <option <?php if(!empty($data)){if($data->publish=='1')echo 'selected="selected"';} ?> value='1'>Hiện</option>';
                                              <option <?php if(!empty($data)){if($data->publish=='0')echo 'selected="selected"';} ?> value='0'>Ẩn</option>';                                              
                                            </select> 
                                            </td></tr>
<tr><td><font color=red>* </font>Danh mục</td><td>
              <script>
                $(document).ready(function(){
                     var parentid = '<?php if(!empty($data)){echo $data->parentid;};?>';
                        $('#'+parentid).attr('selected', 'selected');
                             
                });        
                        
                </script>
                <select name="parentid">
                    <option id="0" value="0" >Danh mục gốc</option>  
                    <?php if($cat) {
                        echo $cat;
                    }?>   
                </select> 
                </td></tr>
<tr><td></font>Meta Desc</td><td><textarea rows="2" cols="40" name="metades"><?php if(!empty($data)){echo $data->metades;};?></textarea></td></tr>
<tr><td></font>Meta Keywords</td><td><textarea rows="2" cols="40" name="metakey"><?php if(!empty($data)){echo $data->metakey;};?></textarea></td></tr>
<tr><td> Thứ tự</td><td><input type="text" size="40" value="<?php if(!empty($data)){echo $data->order;}else echo '0';?>" name="order"/></td></tr>
<tr><td style="text-align: center;" colspan="2"><input class="guidulieu" type="submit" value="Lưu"/></td></tr>
</table>
</div>
</form>
 